import request from "./../utils/request.js"

// 创建订单
export function createOrder(data) {
  return request.post('VisaOrder/CreateOrder', data);
}

// 订单列表
export function orderList(data) {
  // #ifdef MP-WEIXIN
  return request.get('VisaOrder/GetVisaOrderList', data);
  // #endif
  // #ifndef MP-WEIXIN
  return request.get('VisaOrder/GetVisaOrderListAlipay', data);
  // #endif
}

// 查询订单
export function getVisaOrderBasicData(orderId) {
  return request.get('VisaOrder/GetVisaOrderBasicData', {
    orderId
  });
}

// 删除订单
export function delOrder(orderId) {
  return request.get('VisaOrder/DelOrder', {
    orderId
  });
}

// 取消订单
export function cancelOrder(orderId) {
  return request.get('VisaOrder/cancelOrder', {
    orderId
  });
}

// 删除出行人
export function delPassenger(id) {
  return request.get('VisaOrder/DelPassenger', {
    id
  });
}

// 订单详情（个人）
export function getOrderDetail(id) {
  return request.get('VisaOrder/GetOrderDetails', {
    id
  });
}

// 获取旅客申请进展信息（个人）
export function getPassenger(id) {
  return request.get('VisaOrder/GetPassenger', {
    id
  }, {
    noAuth: true
  });
}


// c端订单列表

export function getVisaCutomerOrderList(data) {
  return request.get('VisaOrder/GetVisaCutomerOrderList', data, {
    noAuth: true
  });
}

// 获取历史联系人
export function getHistoryData() {
  return request.get('VisaOrder/GetHistoryData', {});
}

// 申请人上传资料
export function getVisaOrderDetail(id) {
  return request.get('VisaOrder/GetVisaOrderDetail', {
    id
  });
}

// 支付下单
export function orderPayMent(data) {
  return request.post('PayMent/PlaceOrder', data);
}

// 更新订单下的申请人
export function updatePassengers(data) {
  return request.post('VisaOrder/UpdatePassengers', data);
}


// 获取微信支付参数
export function cashPayment(data) {
  return request.post('PayMent/CashPayment', data)
}
export function XhsOrderPayResult(data){
	return request.post('PayMent/XhsOrderPayResult',data);
}
// 余额支付
export function balancePayment(orderId) {
  return request.post('PayMent/BalancePayment', {
    orderId
  })
}


// 获取订单详情
export function getPayOrderDetails(orderId) {
  return request.get('VisaOrder/GetPayOrderDetails', {
    orderId
  })
}


// 单个申请人退款申请
export function refundPassenger(data) {
  return request.get('VisaOrder/RefundPassenger', data, {
    noAuth: true
  })
}


//更新出行时间
export function modifyPlannedDepartureDate(data){
  return request.post('VisaOrder/ModifyPlannedDepartureDate',data , {
    noAuth: false
  });
}  

//获取公司地址
export function GetMyAddress(data){
  return request.get('VisaOrder/GetMyAddress',data , {
    noAuth: false
  });
}  

//绑定物流 顺丰取件客户寄出的物流信息
export function saveLogisticsInfo(data){
  return request.get('VisaOrder/SaveLogisticsInfo',data , {
    noAuth: false
  });
}   
//需补资料
export function GetNeedDoc(data){ 
  return request.get('VisaOrder/GetNeedDoc', data);
} 

// 获取MDAC列表组
export function GetListByGroupNumber(id) {
  return request.get('VisaOrder/GetListByGroupNumber', {
    id
  }, {
    noAuth: true
  });
}
//下载组PDF压缩包
export function ExportZip(passengerId) {
  return request.get('VisaOrder/ExportZip', {
    passengerId
  }, {
    noAuth: true
  });
}

//开发票
export function SaveInvoice(data){
	return request.post('VisaOrder/SaveInvoice',data)
}

//查询开票信息
export function GetInvoice(data){
	return request.get('VisaOrder/GetInvoice',data)
}
export function GetInvoiceByName(data) {
  return request.get('VisaOrder/GetInvoiceByName', data, {
    noAuth: true
  });
  }
export function GetCode(data) {
  return request.get('VisaOrder/GetCode', data, {
    noAuth: true
  });
  }

export function GetPassengerProgress(data) {
  return request.get('OrderAudit/GetPassengerProgress', data, {
    noAuth: false
  });
}
export function SaveSecurityUrl(data) {
  return request.post('SecuriUrl/SaveSecurityUrl', data, {
    noAuth: true
  });
  

}

export function GetTrackingExpress (data)
{
	return request.get('VisaOrder/GetTrackingExpress', data, {
	  noAuth: false
	});
}
